#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This program is free software; you can redistribute it and/or modify  
# it under the terms of the GNU General Public License as published by  
# the Free Software Foundation; either version 2 of the License, or     
# (at your option) any later version.                                   
#                                                                         
# A copy of the license can be found in the license.txt file supplied   
# with this software or at: http://www.gnu.org/copyleft/gpl.html       
#

# protocol status code
PC_OK = 200

PC_SIZE_FORMAT_ERROR = 1101


class   Protocol(object) :
    
    def bind(self, connection) :
        raise NotImplementedError, '%s::bind() NOT implemented' % self.__class__.name
        ## bind()

    def send(self, data, callback=None) :
        raise NotImplementedError, '%s::send() NOT implemented' % self.__class__.name
        ## send()

    def recv(self, data, callback=None) :
        raise NotImplementedError, '%s::recv() NOT implemented' % self.__class__.name
        ## recv()

    def sendrecv(self, data, callback=None) :
        raise NotImplementedError, '%s::sendrecv() NOT implemented' % self.__class__.name
        ## sendrecv()

    ## class Protocol

class   ProtocolFactory(object) :

    def getInstance(self) :
        return Protocol()
        ## getInstance()

    ## class ProtocolFactory()

